package br.com.bonina.contabilidade.core;

import java.util.List;

import org.hibernate.criterion.Order;

public interface Facade <T,K> {
	
	@SuppressWarnings("rawtypes")
	T findById(Class entity, K id) throws BusinessException;
	
	@SuppressWarnings("rawtypes")
	T findByField(Class entity, String field, Object value) throws BusinessException;
	
	@SuppressWarnings("rawtypes")
	List<T> findAllOrder(Class entity, Order order) throws BusinessException;
	
	@SuppressWarnings("rawtypes")
	List<T> findAllbyField(Class entity, String field, Object value, Order order) throws BusinessException;
	
	void save(T entity) throws BusinessException;
	
	void update(T entity) throws BusinessException;
	
	void delete(T entity) throws BusinessException;
}
